We examine the quantum motion of two particles interacting through a contact force which are confined in a rectangular domain in two and three dimensions. When there is a difference in the mass scale of two particles, adiabatic separation of the fast and slow variables can be performed. Appearance of the Berry phase and magnetic flux is pointed out. The system is reduced to a one-particle Aharonov-Bohm billiard in two-dimensional case. In three dimension, the problem effectively becomes the motion of a particle in the presence of closed flux string in a box billiard.